<!-- 意见反馈 -->
<template>
	<view class="wrapper">
		
		<u-button type="success" text="去反馈" @click="goToPage('/pagesB/feedback/addFeedback')"></u-button>
		<div style="margin-bottom: 10px;"></div>
		<view class="item" v-for="(item, index) in dataList" :key="index" >
			<p class="time">分类【{{cate(item.category)}}】</p>
			
			<div class="clearfix"></div>
			<p>反馈内容：{{item.content}}</p>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: []
			}
		},
		onLoad() {
			this.api_listhotline()
		},
		methods: {
			goToPage(url) {
				uni.navigateTo({
					url: url
				})
			},
			cate(val) {
				if (val == 1) {
					return '咨询服务'
				}else if(val == 2) {
					return '我要求助'
				}else if(val == 3) {
					return '投诉举报'
				}else if(val == 4) {
					return '意见建议'
				}else if(val == 5) {
					return '感谢表扬'
				}
			},
			api_listhotline() {
				this.dataList = []
				let openid = uni.getStorageSync('openid')
				this.$app._post_form2('entry/wxapp/apicommon.listhotline', {
					"openid": openid,
					"pageidx": 1,
					"pagesize": 1000
				}, (result) => {
					this.dataList = result
					console.log(result)
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	
	.wrapper {
		box-sizing: border-box;
		padding: 10px;

		.item {
			padding: 10px;
			background-color: #fff;
			border-radius: 8px;
			color: #757575;
			font-size: .8rem;
			margin-bottom: 5px;
		
			p {
				line-height: 25px;
			}
		
			.time {
				color: #ff9800;
				float: left;
			}
		}
	}
</style>